//:C03:ReplaceAndGrow.cpp
#include <cassert>
#include <string>
using namespace std;

int main(){
	string bigNews("I hava been working the grave.");
	string replacement("yard shift");
	// The first argument says "replace chars
	// beyond the end of the existing string":
	bigNews.replace(bigNews.size() - 1,
			replacement.size(),replacement);
	assert(bigNews == "I have been working the"
			"graveyard shift.");
}
